<?php $this->load->view('inc/header');?>
<div class="main-cont">

	<div class="b1"></div>

	<div class="opt-bar">
		<a class="wm-ajax"
		    wmw="300" wmh="200" wmtitle="添加新导航"
		    href="<?php echo site_url('c=sys&m=menu_add');?>">添加新导航</a>
	</div>

	<div class="b1"></div>


	<table id="tbl-menu" class="tbl-menu" cellpadding="0" cellspacing="0" width="100%">
		<thead>
			<tr>
				<th>标题</th>
				<th width="250">控制器名</th>
				<th width="180">方法名</th>
				<th width="100">排序</th>
				<th width="100">是否可见</th>
				<th width="160">操作</th>
			</tr>
		</thead>
	    <tbody>
            <?php foreach ($list_menu as $k=>$v):?>
			<tr>
				<td><?php echo append_str($v->title,$v->depth,'|___');?></td>
				<td><?php echo $v->c;?></td>
				<td><?php echo $v->m;?></td>
				<td><?php echo $v->ord;?></td>
				<td><?php echo $v->is_v;?></td>
				<td>
				    <?php if($v->depth != 2):?>
				    <a 	class="wm-ajax"
				        wmw="300" wmh="200" wmtitle="添加子导航"
				        href="<?php echo site_url('c=sys&m=submenu_add').'&pid='.$v->id.'&depth='.$v->depth;?>">添加子导航</a>
				    <?php endif;?>
				    <a  class="wm-ajax"
				        wmw="300" wmh="200" wmtitle="编辑导航"
				        href="<?php echo site_url('c=sys&m=menu_edit').'&id='.$v->id;?>">编辑</a>
				    
				    <a  class="btn-ajax-confirm"
				        msg="确定要删除吗？"				        		        
				        href="<?php echo site_url('c=sys&m=menu_del').'&id='.$v->id;?>">删除</a>
				</td>
			</tr>
        	<?php endforeach;?>
		</tbody>
	</table>
    
	
</div>
<?php $this->load->view('inc/footer');?>

<script>$(function(){
	
	//开关效果，暂不用
    $('#tbl-menu tbody tr').toggle(function(){
        var vid = $(this).attr('vid');
        $(this).parent().find('tr[pid='+vid+']').show();
    },function(){
        var vid = $(this).attr('vid');
        $(this).parent().find('tr[pid='+vid+']').hide();
    });

	
});</script>